gdkclipboard-win32.c: Fix call to gdk_clipboard_claim_remote()
authorChun-wei Fan <fanchunwei@src.gnome.org>
Thu, 31 Mar 2022 02:36:45 +0000 (10:36 +0800)
committerChun-wei Fan <fanchunwei@src.gnome.org>
Thu, 31 Mar 2022 02:55:39 +0000 (10:55 +0800)
commit8519ab56f51eeba585fe5b2d3f2ab3c322904621
treeb72e65c2a93a3e689c347ebb9827e15e3b119290
parent04c9c6b4284110746089adadc12701b7f3bbf379
gdkclipboard-win32.c: Fix call to gdk_clipboard_claim_remote()

The call to gdk_win32_clipboard_request_contentformats() can return NULL even
without an error condition being hit (such as when the system clipboard is
empty), so check whether the returned GdkContentFormat pointer is not NULL
before calling gdk_clipboard_claim_remote(), which expects it to be not NULL,
otherwise we face a warning from that funtion and the subsequent
g_object_unref().

This at least partially fixes issue #4796.
gdk/win32/gdkclipboard-win32.c